<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />
		<meta name="format-detection" content="telephone=no">
		<meta name="format-detection" content="email=no">
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<title></title>
		<link rel="stylesheet" href="../css/reset.css" />
	</head>
	<body>
		<div class="prompt" id="prompt">您的网络不给力哦~~</div>
		<script type="text/javascript" src="../js/jquery-1.10.1.min.js" ></script>
		<script type="text/javascript" src="../js/config.js" ></script>
		<script type="text/javascript" src="../js/get_url_parameter.js" ></script>
		<script>
			//微信中检查phone是否绑定开始---------------------------------------------------
			var phone;
			var code=request("code");
			$.ajax({
			    url: DATA_URL+"checkwxbind",
			    data: "code="+code,
			    type: "post",
			    async: false,
			    dataType: 'json',
			    timeout: 5000,
			    success:function (data) {
			    	if(data.code=="0"){
			    		if(data.info.is_bind==1){
			    			phone=data.info.phone;
			    			sessionStorage.setItem("phone",data.info.phone);
			    			location.href="binding_success.html"
			    		}
			    		else{
			    			var open_id=data.info.open_id;
			    			location.href="binding_phone.html?open_id="+open_id
			    		}
			    	}
					else{
						$("#prompt").text(data.msg);
			            $(".prompt").fadeIn(300,function(){
			                setTimeout(function(){$(".prompt").fadeOut(300)},3000)
			            })
					}
			    },
			    error:function () {
			    	$("#prompt").text("您的网络不给力哦~");
			        $(".prompt").fadeIn(300,function(){
			            setTimeout(function(){$(".prompt").fadeOut(300)},3000)
			        })
			    }
			});
			//微信中检查phone是否绑定结束-----------------------------------------------------------
		</script>
	</body>
</html>
